#include "Riskgis.h"
#include <qgsapplication.h>
#include<qgsproviderregistry.h>
#include<qgsnativealgorithms.h>
#include <QApplication>
//#include<qgssettings.h>
int main(int argc, char *argv[])
{
    QgsApplication a(argc, argv,false);
    //设置qgis应用的路径
    QgsApplication::setPrefixPath(".", true);
    QgsApplication::initQgis();  //初始化QGIS应用
    QgsProviderRegistry::instance("C:/OSGeo4W64/apps/qgis-ltr/plugins");
    QgsApplication::processingRegistry()->addProvider( new QgsNativeAlgorithms( QgsApplication::processingRegistry() ) );
    qDebug() << "QGIS data providers loaded:" << QgsProviderRegistry::instance()->providerList() << "\n";
    // 设置 GDAL 数据目录环境变量
    qputenv("GDAL_DATA", "C:/OSGeo4W64/share/gdal");
    QString desiredStyle =QStringLiteral( "fusion" );
    QApplication::setStyle(desiredStyle);
    Riskgis w;
    w.show();
    return a.exec();
}
